Don't allocate in PackageId::hash
authorAlex Crichton <alex@alexcrichton.com>
Fri, 29 May 2015 21:19:39 +0000 (14:19 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 3 Jun 2015 01:05:47 +0000 (18:05 -0700)
commit499f485f3d34a53fcedb4a2ea95f9aff9bff8241
tree5c38969d6e44e99c362eca9208e0c5bee81e2059
parent81ecf8bd82ad56610499e135f1b37093461d576a
Don't allocate in PackageId::hash

This hash function is called an enormous number of times in `cargo_rustc`, so
optimizing it is fairly important, and it's also quite trivial to not allocate a
string at all (`semver::Version::hash` already does everything we need).
src/cargo/core/package_id.rs